[WIP] Add blank lines after semicolons #31
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A blank line is added after every line that:
within
statement on it[]
(matrix notation)Issues:
Two blank lines are added if a file ends with a semicolon. The tests are not passing because of that.
I am not sure how to solve this problem. I thought about checking for
end
on a given line, but we can have multipleend
in one file. And this should only care about the lastend
.One of my ideas is to check for main class/model name (i.e. the one in the 2nd line) and add another
if
statement that checks if we're in the correctend
statement. But I noticed that you have trailing comments at the end of test files (e.g. this one) so this approach would also break here, because a blank line would be missing, but it shouldn't.Any better ideas? I am not too familiar with antrl 😄
I added new test
.mo
files that help to verify:within
statement from any reason (might be useful for formatting code snippets etc.)